package com.itfenghuang;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.util.Scanner;

public class A02_修改 {
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        //加载驱动
        Class.forName("com.mysql.jdbc.Driver");
        //获取连接
        Connection root = DriverManager.getConnection
                ("jdbc:mysql://127.0.0.1:3306/aa_chun_day02", "root", "123456");
        String sql="update student set sage=? where sid=?";
        PreparedStatement pp = root.prepareStatement(sql);
        pp.setInt(1,sc.nextInt());
        pp.setInt(2,sc.nextInt());
        int i = pp.executeUpdate();


    }
}
